import  requests
def get_image(url):
    try:
        r =requests.get(url)
        r.raise_for_status()
        return  r.content
    except  Exception as err:
        print(err)
def save_imag(path,content):
    with open(path,"wb")as f:
        f.write(content)
if __name__ == "__main__":
    url_list=["	https://c-ssl.dtstatic.com/uploads/blog/202303/29/20230329110528_26e2e.thumb.300_300_c.jpeg",
              "https://pic.rmb.bdstatic.com/bjh/240115/events/bedb7e388ccedf5846348561bc36f0e93367.gif"]
    for url in url_list:
        imag_content=get_image(url)
        dir="D:\\AAA\\"
        file_name=url.split("/")[-1:][0]
        path=dir+file_name
        save_imag(path,imag_content)